package com.qiaoba.api.system.entity.dto;

import com.qiaoba.common.base.validate.AddGroup;
import com.qiaoba.common.base.validate.EditGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 菜单 DTO
 *
 * @author ailanyin
 * @date 2023-09-10 11:37:57
 */
@Data
public class SysMenuDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "菜单ID")
    @NotNull(message = "菜单ID不能为空", groups = {EditGroup.class})
    @Size(max = 20, message = "菜单ID不能超过{max}个字符", groups = {EditGroup.class})
    private String menuId;

    @Schema(description = "菜单名称")
    @NotBlank(message = "菜单名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 30, message = "菜单名称不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String menuName;

    @Schema(description = "父菜单ID")
    @NotBlank(message = "父ID不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 20, message = "父ID不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String parentId;

    @Schema(description = "显示顺序")
    @Min(value = 1, message = "排序最小允许: {value}", groups = {AddGroup.class, EditGroup.class})
    private Integer orderNum;

    @Schema(description = "路由地址")
    @Size(max = 50, message = "路由地址不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String path;

    @Schema(description = "组件路径")
    @Size(max = 50, message = "组件路径不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String component;

    @Schema(description = "路由参数")
    @Size(max = 100, message = "路由参数不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String query;

    @Schema(description = "是否为外链（0否 1是）")
    @Size(max = 1, message = "外链不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String isFrame;

    @Schema(description = "是否缓存（0不缓存 1缓存）")
    @Size(max = 1, message = "缓存不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String isCache;

    @Schema(description = "类型（M目录 C菜单 F按钮）")
    @Size(max = 1, message = "类型不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String menuType;

    @Schema(description = "显示状态（0隐藏 1显示）")
    @Size(max = 1, message = "显示状态不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String isVisible;

    @Schema(description = "权限字符串")
    @Size(max = 50, message = "权限字符串不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String perms;

    @Schema(description = "菜单图标")
    @Size(max = 30, message = "菜单图标不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String icon;
}
